package users

import (
	"C_ProblemWorkOrder/model"
	"strconv"
)


type User struct {
	Name string
	Passwd string
	Phone string
}

type SetUser struct {
	User
	OldName string
}

var m = model.MysqlOrm{}

// 注册用户
func (u User)AddUser() error{
	res ,err := strconv.Atoi(u.Phone)
	if err != nil{
		return err
	}
	err = m.AddUser(u.Name, u.Passwd, res)
	if err != nil{
		return err
	}
	return nil
}
